package ihm;

import javax.swing.JFrame;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JTextField;
import javax.swing.JSpinner;
import javax.swing.JComboBox;
import javax.swing.JButton;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public class FrmModifierTache extends JFrame{
	public FrmModifierTache() {
		
		JLabel lblModifierTache = new JLabel("MODIFIER TACHE");
		
		JLabel lblNumroTache = new JLabel("Numéro Tache :");
		
		JLabel lblLibelle = new JLabel("Libelle :");
		
		JLabel lblChargePrvisionelleJourhomme = new JLabel("Charge prévisionelle");
		
		JLabel lblJourhomme = new JLabel("jour/homme :");
		
		JLabel lblMatriculeCollaborateur = new JLabel("Matricule collaborateur :");
		
		JLabel lblRfrenceContrat = new JLabel("Référence contrat :");
		
		txtNumeroTacheModifier = new JTextField();
		txtNumeroTacheModifier.setColumns(10);
		
		txtLibelleModifier = new JTextField();
		txtLibelleModifier.setColumns(10);
		
		JSpinner spnChargeModifier = new JSpinner();
		
		JComboBox cmbMatriculeModifier = new JComboBox();
		
		JComboBox cmbReferenceModifier = new JComboBox();
		
		JButton btnModifier = new JButton("Modifier");
		
		JButton btnQuitter = new JButton("Annuler");
		btnQuitter.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
				dispose();
			}
		});
		GroupLayout groupLayout = new GroupLayout(getContentPane());
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
							.addComponent(lblMatriculeCollaborateur)
							.addComponent(lblJourhomme)
							.addComponent(lblChargePrvisionelleJourhomme)
							.addComponent(lblLibelle)
							.addComponent(lblNumroTache)
							.addComponent(lblRfrenceContrat))
						.addComponent(btnModifier))
					.addGap(18)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
							.addComponent(cmbMatriculeModifier, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
							.addComponent(txtNumeroTacheModifier)
							.addComponent(txtLibelleModifier)
							.addComponent(spnChargeModifier, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
						.addComponent(cmbReferenceModifier, GroupLayout.PREFERRED_SIZE, 86, GroupLayout.PREFERRED_SIZE)
						.addComponent(btnQuitter, GroupLayout.PREFERRED_SIZE, 97, GroupLayout.PREFERRED_SIZE))
					.addContainerGap(209, Short.MAX_VALUE))
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(104)
					.addComponent(lblModifierTache)
					.addContainerGap(260, Short.MAX_VALUE))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addComponent(lblModifierTache)
					.addGap(31)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblNumroTache)
						.addComponent(txtNumeroTacheModifier, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addGap(18)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblLibelle)
						.addComponent(txtLibelleModifier, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addGap(18)
					.addComponent(lblChargePrvisionelleJourhomme)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblJourhomme)
						.addComponent(spnChargeModifier, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addGap(18)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblMatriculeCollaborateur)
						.addComponent(cmbMatriculeModifier, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addGap(18)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblRfrenceContrat)
						.addComponent(cmbReferenceModifier, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(btnModifier)
						.addComponent(btnQuitter))
					.addContainerGap(57, Short.MAX_VALUE))
		);
		getContentPane().setLayout(groupLayout);
	}
	
	private JFrame ajoutertache;
	private JTextField txtNumeroTacheModifier;
	private JTextField txtLibelleModifier;
}
